Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active moderate issues remain in both production timer synchronization and test independence, so the change is not yet ready for approval.
2 open issues
What changed in this PR
This pull request improves wallpaper scheduling across time zones, daylight-saving transitions, shuffle intervals, concurrent scheduler activity, and multi-display configurations.
Changes:
- Preserve location timezone offsets and handle DST boundary calculations for solar scheduling.
- Correct 12-hour and monthly shuffle deadlines, including sunrise behavior during dawn.
- Serialize scheduler and display updates while improving display hotplug recovery and cached wallpaper consistency.
- Validate per-display CLI selections and improve lock-screen synchronization, restart handling, and power/session notifications.
- Add regression coverage for timezone, dawn, and DST-gap scenarios.
| File | Summary | Review Notes |
|---|---|---|
test/SunCalcTests.cs |
Adds timezone, dawn, and DST regression tests. | The DST-gap expected value is derived from the implementation under test and should be computed independently. |
src/UpdateChecker.cs |
Documents Windows application-restart registration behavior. | No findings reported. |
src/ThemeShuffler.cs |
Corrects 12-hour and monthly shuffle deadlines. | No findings reported. |
src/SunriseSunset.cs |
Preserves the selected location’s UTC offset during solar calculations. | No findings reported. |
src/SolarScheduler.cs |
Keeps sunrise scheduled as the next update during dawn. | No findings reported. |
src/IpcManager.cs |
Validates per-display theme selections while preserving other displays. | No findings reported. |
src/HiddenForm.cs |
Improves restart registration and session-end handling. | No findings reported. |
src/EventScheduler.cs |
Serializes scheduler operations and refreshes display state after changes. | Timer callbacks are not coalesced while waiting for the scheduler lock, and the deadline check/rearm sequence is not atomic under the lock. |
src/COM/PowerSetting.cs |
Safely handles session display-status notifications and payload validation. | No findings reported. |
Review effort: Lite
Comment on lines
+306
to
321
| if (e.Mode != PowerModes.Resume) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| if (UpdateDisplayList() || (nextUpdateTime.HasValue && DateTime.Now >= nextUpdateTime.Value)) | ||
| { | ||
| LoggingHandler.LogMessage("Scheduler event triggered by resume from sleep"); | ||
| HandleTimerEvent(false); | ||
| } | ||
| else if (nextUpdateTime.HasValue) | ||
| { | ||
| // Relative timers exclude sleep time, so rearm even when the deadline is still in the future. | ||
| StartTimer(nextUpdateTime.Value); | ||
| } | ||
| } |
|
|
||
| SolarData data = SunriseSunsetService.GetSolarData(transitionDate); | ||
| SunriseSunsetService.GetDateTimeNow = () => transitionDate.AddHours(12); | ||
| SolarData expected = SunriseSunsetService.GetSolarData(transitionDate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix scheduling failures that could select the wrong solar day, repeatedly trigger timers, or leave wallpapers inconsistent after concurrent updates and display changes.
Changes:
Validation:
How to test:
Manual checks:
/theme:2=<theme-id>from an “All Displays” configuration. Confirm display 1 retains its theme and invalid display numbers are rejected.Physical hotplug, live Windows timezone changes, and interactive UI checks remain to be exercised.